import Qt 4.7

Rectangle {
    id: box

    width: 100; height: 52
    color: "white"
    radius: 5
    border { color: "#222222"; width: 2 }

    property alias text: textInput.text
    property alias echoMode: textInput.echoMode
    property int fontPointSize: 8

    signal textFilled

    TextInput {
        id: textInput

        width: parent.width; height: parent.height
        anchors { margins: 10; fill: parent }
        color: "black"
        font { pointSize: box.fontPointSize; weight: Font.DemiBold; family: "Series 60 Sans" }

        property bool alreadyFilled: false

        onFocusChanged: {
            if (focus == true) {
                parent.border.color = "#00adef"
                alreadyFilled = true;
            } else {
                parent.border.color = "#222222"
                if (alreadyFilled) {
                    box.textFilled()
                }
            }
        }
    }
}
